<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box1{
            /*定义使用弹性盒模型布局*/
            /*float，clear，vertical-align会失效*/
            /*被此包括的子元素叫做项目*/
            /*默认是主轴水平排列，交叉轴是垂直排列*/
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            width: 300px;
            height: 300px;
            background-color: #999999;
        }
        .box1 div{
            width: 50px;
            height: 50px;
            background-color: pink;
            margin: 3px;
            border: 1px solid #000000;
            /*高宽包含内边距*/
            box-sizing: border-box;
        }
    </style>
</head>
<body>
<div class="box1">
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
</div>
</body>
</html>